
package com.contractmodule.bean;

import com.companymodule.bean.TbCompanyProductTypeMiddle;
import com.companymodule.dao.TbCompanyProductTypeMiddleDAO;
import com.contractmodule.dao.TbContractDAO;
import com.usersmodule.bean.TbUsers;
import com.usersmodule.dao.TbUsersDAO;

public class TbDispatchList implements java.io.Serializable {

    private int dispatchListId;

    private String dispatchListCode;

    private String contractCode;
    private TbContract tbContract;

    private int companyProductTypeMiddleId;
    private TbCompanyProductTypeMiddle tbCompanyProductTypeMiddle;

    private String dispatchListName;

    private String dispatchListBudget;

    private int userId;
    private TbUsers tbUsers;
    private String createTime;

    public int getDispatchListId(){
        return dispatchListId;
    }

    public void setDispatchListId(int dispatchListId){
        this.dispatchListId = dispatchListId;
    }

    public String getDispatchListCode(){
        return dispatchListCode;
    }

    public void setDispatchListCode(String dispatchListCode){
        this.dispatchListCode = dispatchListCode;
    }

    public String getContractCode(){
        return contractCode;
    }

    public void setContractCode(String contractCode){
        this.contractCode = contractCode;
        this.tbContract=new TbContractDAO().getTbContractByContractCode(contractCode);
    }
    
    public TbContract getTbContract() {
		return tbContract;
	}

	public void setTbContract(TbContract tbContract) {
		this.tbContract = tbContract;
	}

	public int getCompanyProductTypeMiddleId(){
        return companyProductTypeMiddleId;
    }

    public void setCompanyProductTypeMiddleId(int companyProductTypeMiddleId){
        this.companyProductTypeMiddleId = companyProductTypeMiddleId;
        this.tbCompanyProductTypeMiddle=new TbCompanyProductTypeMiddleDAO().getTbCompanyProductTypeMiddleByCompanyProductTypeMiddleId(companyProductTypeMiddleId);
    }
    
    public TbCompanyProductTypeMiddle getTbCompanyProductTypeMiddle() {
		return tbCompanyProductTypeMiddle;
	}

	public void setTbCompanyProductTypeMiddle(
			TbCompanyProductTypeMiddle tbCompanyProductTypeMiddle) {
		this.tbCompanyProductTypeMiddle = tbCompanyProductTypeMiddle;
	}

	public String getDispatchListName(){
        return dispatchListName;
    }

    public void setDispatchListName(String dispatchListName){
        this.dispatchListName = dispatchListName;
    }

    public String getDispatchListBudget(){
        return dispatchListBudget;
    }

    public void setDispatchListBudget(String dispatchListBudget){
        this.dispatchListBudget = dispatchListBudget;
    }

    public int getUserId(){
        return userId;
    }

    public void setUserId(int userId){
        this.userId = userId;
        this.tbUsers=new TbUsersDAO().getTbUsersByUserId(userId);
    }

    public TbUsers getTbUsers() {
		return tbUsers;
	}

	public void setTbUsers(TbUsers tbUsers) {
		this.tbUsers = tbUsers;
	}

	public String getCreateTime(){
        return createTime;
    }

    public void setCreateTime(String createTime){
        this.createTime = createTime;
    }


    public TbDispatchList(){
    }
    public TbDispatchList(String dispatchListCode,String contractCode,int companyProductTypeMiddleId,String dispatchListName,String dispatchListBudget,int userId){
        this.dispatchListCode = dispatchListCode;
        this.contractCode = contractCode;
        this.companyProductTypeMiddleId = companyProductTypeMiddleId;
        this.dispatchListName = dispatchListName;
        this.dispatchListBudget = dispatchListBudget;
        this.userId = userId;
    }
    public TbDispatchList(int dispatchListId,String dispatchListCode,String contractCode,int companyProductTypeMiddleId,String dispatchListName,String dispatchListBudget,int userId){
        this.dispatchListId = dispatchListId;
        this.dispatchListCode = dispatchListCode;
        this.contractCode = contractCode;
        this.companyProductTypeMiddleId = companyProductTypeMiddleId;
        this.dispatchListName = dispatchListName;
        this.dispatchListBudget = dispatchListBudget;
        this.userId = userId;
    }
}

